<script setup lang="ts">
import {EButton, EDialog} from 'exploria-ui';
import {ref} from 'vue';

const open = ref(false);
const isWaitingOpen = ref(false);

const openModal = () => {
    isWaitingOpen.value = true;
    setTimeout(() => {
        open.value = true;
        isWaitingOpen.value = false;
    }, 2000);
};
</script>

<template>
    <div class="async-using">
        <EDialog
            v-model:open="open"
            title="这是 Modal 的标题"
            :is-waiting-open="isWaitingOpen"
        >
            <div>内容</div>
        </EDialog>
        <EButton @click="openModal" :loading="isWaitingOpen">
            显示
        </EButton>
    </div>
</template>

<style scoped lang="scss"></style>
